package com.example.demo.lc;

/**
 * @Description TODO
 * @Author wzh
 * @Date 2021/11/16 4:41 下午
 * @Version 1.0
 */
public class Leetcode1780 {
    public static void main(String[] args) {
        System.out.println(checkPowersOfThree(12));
    }


    public static boolean checkPowersOfThree(int n) {
        while (n > 0) {
            if (n % 3 > 1) {
                return false;
            }
            n = n / 3;
        }
        return true;
    }
}
